package com.zy.chapter5

/**
 * @author: zhaoyi
 * @create: 2020-04-24 00:03
 * @description: 构造器私有
 **/
class PrivateConstructor private(name: String, age: Int) {

  var sex = true

  //柱构造器私有了， 目前只能通过这个辅助构造器创建了
  def this(name:String,age:Int,sex: Boolean){
    this(name,age)
    this.sex = sex
  }

}
